package com.teacher.pc.controller;


import com.teacher.common.CommonResult;
import com.teacher.pojo.dto.courseconteststask.CourseContestsTaskAddDto;
import com.teacher.pojo.dto.courseconteststask.CourseContestsTaskUpdateDto;
import com.teacher.pojo.dto.culturalactivitiesrewardtask.CulturalActivitiesRewardTaskAddDto;
import com.teacher.pojo.dto.culturalactivitiesrewardtask.CulturalActivitiesRewardTaskUpdateDto;
import com.teacher.pojo.vo.courseconteststask.CourseContestsTaskGetVo;
import com.teacher.pojo.vo.culturalactivitiesrewardtask.CulturalActivitiesRewardTaskGetVo;
import com.teacher.service.ICourseContestsTaskService;
import com.teacher.service.ICulturalActivitiesRewardTaskService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 * 文艺活动奖项 前端控制器
 * </p>
 *
 * @author zfm
 * @since 2021-08-13
 */
@RestController
@RequestMapping("/pc/cultural-activities-reward-task")
public class CulturalActivitiesRewardTaskController {

    @Autowired
    private ICulturalActivitiesRewardTaskService iCulturalActivitiesRewardTaskService;

    /**
     * 发起文艺活动奖项审批流程
     *
     * @param dto
     * @return
     */
    @PostMapping
    @ApiOperation("发起文艺活动奖项审批流程")
    public CommonResult<String> add(@RequestBody CulturalActivitiesRewardTaskAddDto dto) {
        return iCulturalActivitiesRewardTaskService.add(dto);
    }

    /**
     * 更新流程
     *
     * @param dto
     * @return
     */
    @PutMapping
    @ApiOperation("更新流程")
    public CommonResult<String> update(@RequestBody CulturalActivitiesRewardTaskUpdateDto dto) {
        return iCulturalActivitiesRewardTaskService.updateInfo(dto);
    }

    /**
     * 获取详情
     *
     * @return
     */
    @GetMapping("/{flowId}")
    @ApiOperation("获取详情")
    public CommonResult<CulturalActivitiesRewardTaskGetVo> getDetails(@PathVariable("flowId") Long id) {
        return iCulturalActivitiesRewardTaskService.getDetails(id);
    }

}

